package com.wao.cms.service.mapper;

import com.wao.cms.domain.*;
import com.wao.cms.service.dto.FooterDTO;

import org.mapstruct.*;

/**
 * Mapper for the entity Footer and its DTO FooterDTO.
 */
@Mapper(componentModel = "spring", uses = {WebsiteMapper.class, })
public interface FooterMapper extends EntityMapper <FooterDTO, Footer> {

    @Mapping(source = "website.id", target = "websiteId")
    @Mapping(source = "website.name", target = "websiteName")
    FooterDTO toDto(Footer footer); 

    @Mapping(source = "websiteId", target = "website")
    Footer toEntity(FooterDTO footerDTO); 
    default Footer fromId(Long id) {
        if (id == null) {
            return null;
        }
        Footer footer = new Footer();
        footer.setId(id);
        return footer;
    }
}
